Draft Architecture L2
Cirkle Blockchain Architecture
βββββββββββββββ
β Explorer β
β β
βββββββ²ββββββββ
β JSON-RPC
β
ββββββββββββββ libp2p Gossipsub βββββββββββββββββ
β β ββββββββββββββββββββββββββββΊ β β
β CLI Walletβ libp2p PubSub & β Core Node β
β β Peer Discovery β β
ββββββββββββββ βββββββββββββββββ
β² β²
β β
β βββββββββββββ΄ββββββββββββ
β β Consensus Engine β
β β (PoS Validator β
β β Selection + BFT) β
β βββββββββββββ²ββββββββββββ
β β State
β β Transition
β β
β JSON-RPC / gRPC βββββββββββββ΄ββββββββββββ
ββββββββββββββββββββββββββββββββββ State Machine β
β (EVM Engine + Merkle β
β Trie) β
βββββββββββββ²ββββββββββββ
β
β
ββββββββββββ΄ββββββββββββ
β Mempool β
β (TX Pool + Validator β
β Block Assembler) β
ββββββββββββ²ββββββββββββ
β Blocks & TXs
β
libp2p β
PubSub β
β
βββββββββββββββββ ββββββ΄βββββ
β Relayer / β β Bridge β
β Monitoring β β Module β
β & Metrics β βββββββββββ
β (Prom/Graf) β
βββββββββββββββββ
Components
Components 1, 2, 3, 4 are required for an MVP
P2P Layer (libp2p)
- Peer Discovery via mDNS/DHT
- Gossipsub for:
- Transaction propagation
- Block propagation
- Secure Channels (Noise/TLS)
Core Node (Go)
- Consensus Engine
- PoS validator selection
- BFT finality
- State Machine
- EVM-compatible execution (go-ethereumβs
evmpackage) - Merkle trie for world state
- EVM-compatible execution (go-ethereumβs
- Mempool & Block Assembler
- Transaction validation, gas accounting
- Block creation by elected validator
- APIs
- JSON-RPC & gRPC for wallets, explorer, and relayer
- REST for health checks
- Consensus Engine
Wallet (CLI & MetaMask-compatible)
- Key management (BIP-39, secp256k1)
- Transaction creation & signing
- Peer discovery for local devnet (optional via libp2p)
- RPC calls to Core Node for balance & tx submission
Bridge Module
- Relayer Service listens to:
- Ethereum deposit events (via web3)
- Cirkle withdrawal events (via libp2p PubSub or RPC)
- Initiates cross-chain mint/burn transactions
- Relayer Service listens to:
Explorer (React/NextJS)
- Indexer Service (Go) subscribes to libp2p PubSub or polls JSON-RPC
- Stores blocks/txs in database
- Exposes REST/GraphQL for frontend
- Real-time updates via WebSocket
Monitoring & Metrics
- Prometheus exporter in Core Node and Explorer
- Grafana dashboards for:
- Peer count, mempool size, block times
- Validator performance & uptime
Data Flows
Transaction Flow: Wallet βΆ JSON-RPC βΆ Core Node βΆ libp2p PubSub βΆ All Peers βΆ Mempool βΆ Block Assembler βΆ Block PubSub βΆ All Peers βΆ State Machine
Block Propagation: Core Node (Validator) βΆ libp2p Gossipsub βΆ Other Nodes βΆ Block Validation βΆ State Update
Explorer Indexing: Explorer Indexer βΆ (libp2p subscription or RPC polling) βΆ Processes Blocks/Txs βΆ Database βΆ API βΆ Frontend
Cross-Chain Bridge: Relayer βΆ Ethereum βΆ Bridge Contract βΆ Events βΆ Cirkle βΆ libp2p or RPC βΆ Mint/Burn on Cirkle
Loading comments...